﻿<%@ Page Title="Facturas" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
 CodeBehind="Facturas.aspx.cs" Inherits="Restaurante.Facturas"%>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
         <p id="titulo"> Facturas </p>
    </h2>
    <div class="contTabla">
        <asp:GridView ID="gvFacturas" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="Nro_Factura" DataSourceID="FacturasGrilla" CellPadding="4" 
            ForeColor="#333333" GridLines="None">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField DataField="Nro_Factura" HeaderText="Nro Factura" 
                    InsertVisible="False" ReadOnly="True" SortExpression="Nro_Factura" />
                <asp:BoundField DataField="cliente" HeaderText="cliente" 
                    SortExpression="cliente" />
                <asp:BoundField DataField="mesa" HeaderText="mesa" 
                    SortExpression="mesa" />
                <asp:BoundField DataField="Monto" HeaderText="Monto" SortExpression="Monto" />
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
        <asp:SqlDataSource ID="FacturasGrilla" runat="server" 
            ConnectionString="<%$ ConnectionStrings:BarCafe %>" 
            ProviderName="<%$ ConnectionStrings:BarCafe.ProviderName %>" 
            SelectCommand="select f.Nro_Factura, 
	cl.Nombre cliente,	
	m.Descripcion mesa,
	f.Monto	
	from Factura f,
	     Usuario u,
		 Mesa m,
		 Comanda c,
		 Cliente cl
where u.Id_Usuario = f.id_usuario  
  and c.Nro_Comanda = f.id_comanda
  and m.Id_Mesa = c.Id_Mesa
  and cl.Id_Cliente = c.Id_Cliente
"></asp:SqlDataSource>
    </div>

    <div class="contTabla">
            
     <asp:Button ID="btnCancelarComanda" runat="server" Text="Cancelar" 
            onclick="btnCancelarComanda_Click"  />             
    </div>
    
</asp:Content>
